Proto: add "battery status" to channel state info.#607
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bae98cd032
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #define SUPLA_CHANNELSTATE_FIELD_BATTERY_STATE 0x20000 | ||
| // Device battery state is used to inform server that channel's battery state | ||
| // should be applied to whole device | ||
| #define SUPLA_CHANNELSTATE_FIELD_DEVICE_BATTERY_STATE 0x40000 |
There was a problem hiding this comment.
Persist the new battery-state flags
When a device sets SUPLA_CHANNELSTATE_FIELD_BATTERY_STATE or SUPLA_CHANNELSTATE_FIELD_DEVICE_BATTERY_STATE, the server receives the raw TDSC_ChannelState, but the persistence path serializes channel state through supla_channel_state::get_json() before supla_device_dao::update_channel_state, and that JSON code only handles batteryHealth / deviceBatteryLevel today. In that scenario the new battery status is dropped from the database and will be absent for clients that load channel state from persisted JSON after reconnect/restart, so the proto addition needs matching JSON serialization/deserialization for these flags.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23390237e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // value 1 (0 %) means "OFF" | ||
| unsigned char AlarmMuted; // 0 - not used, 1 - alarm is muted, 2 - alarm is | ||
| // not muted | ||
| unsigned char LocalAlarmIndication; // 0 - not used, |
There was a problem hiding this comment.
Keep the binary sensor config member name compatible
When building the server code that includes this header, supla-server/src/jsonconfig/channel/binary_sensor_config.cpp and its tests still access TChannelConfig_BinarySensor::AlarmMuted; after this rename the struct no longer has that member, so those targets fail to compile as soon as they include the updated protocol header. Either keep the existing member name or update all users in the same change.
Useful? React with 👍 / 👎.
No description provided.